<template>
  <div class="worklog-box">
    <ul>
      <li v-for="log in logList" v-bind:key="log.finishDate">
        <span v-if="log.isPass==-1">{{ log.finishDate + ' ' + log.groupName + '提交的' + log.jobName + '活动被'}}
        <span style="color: #dc143c;font-weight: 600">驳回</span>。</span>
        <span v-if="log.isPass==1">{{ log.finishDate + ' ' + log.groupName + '提交的' + log.jobName + '活动'}}
          <span style="color: #04aef9;font-weight: 600">通过审核</span>。
        </span>
        <span v-if="log.isPass==0">{{ log.finishDate + ' ' + log.groupName + '提交了' + log.jobName + '活动'}}。</span>
      </li>
      <li v-if="logList.length === 0">暂无信息</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'worklog',
  data () {
    return {
      logList: [],
      pageNo: null,
      timee: null
    }
  },
  created () {
    this.getLogList()
    this.timer = setInterval(() => {
      this.getLogList()
    }, 15000)
  },
  methods: {
    getLogList: function () {
      this.$http.get('/server/job/getJobsLog?pageNo=')
        .then(function (res) {
          this.logList = res.data.data.objectList
        })
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.worklog-box{
  line-height: 20px;
  max-height: 120px;
  color: #3a3a3a;
  font-size: 12px;
  overflow: auto;
}
</style>
